<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>列表页</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">

		<!--标准mui.css-->
		<link rel="stylesheet" href="__PUBLIC__/css/mui.min.css">
		<!--App自定义的css-->
		<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/app.css" />
		<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav">
			<a onclick="dump('{:U('Storehouse/join')}')" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<script>
                //url跳转
                function dump(url) {
                    location.href=url
                }
			</script>
			<h1 class="mui-title">仓库(列表)</h1>
			<a href="{:U('mycangkubaidu')}" class="mui-qiehuan-icon  mui-pull-right"></a>
		</header>
		<div class="mui-content">
			<div class="mui-select-list">
				<i class="mui-sanjiao"></i>
			<select id="select" class="zulin-list-se" >
				<option <if condition="$FiltStr eq 'A'">selected</if> value="A">所有仓库</option>
					<option <if condition="$FiltStr eq 'N'">selected</if> value="N">待审核仓库</option>
				</select>
			</div>	
			<ul id="he" class="mui-table-view">
				<foreach name="data" item="vo">
				<li class="mui-table-view-cell mui-media">
					<a href="{:U('GET_MYWH',array('id'=>$vo['StoreID']))}" class="wspin">
						<if condition="$vo[PhotoUrl] eq ''">
							<img class="mui-media-object mui-pull-left mui-sc-img" src="http://bpic.588ku.com/element_origin_min_pic/01/47/02/12574338a640011.jpg">
							<else/>
							<img class="mui-media-object mui-pull-left mui-sc-img" src="{$vo.PhotoUrl}">
						</if>

						<div class="mui-media-body mui-sc-list">
							<p class="mui-sc-p">{$vo.Name}</p>
							<p><lable>位置:</lable><i>{$vo.Addr}</i></p>
							<p><lable>价格:</lable><i>{$vo.PriceCust}元</i></p>
							<if condition="$vo['Examined'] eq 'FALSE'">
								<button type="button" class="mui-btn mui-dsh-icon"><i></i> 未审核</button>
								<else />
								<button type="button" class="mui-btn mui-wcz-icon"><i></i> 已审核</button>
							</if>

						</div>
					</a>
				</li>
				</foreach>
			</ul>
			<button onclick="dump('{:U('addCangku')}')" type="button" class="mb20 mui-btn-sz ">添加仓库</button>
		</div>
	</body>
</html>
<script>
	$('#select').change(function()
	{
        var url = window.location.href;
	    var val = $(this).val()
		location.href = url+'&FiltStr='+val
	})
</script>
<script>
    var page = 1, //分页码
        off_on = false, //分页开关(滚动加载方法 1 中用的)
        timers = null; //定时器(滚动加载方法 2 中用的)
    //还可以基window窗口（body）来添加滚动事件, (因为布局不同,所以在这里没效果，因为[上面是基于body中的某个元素来添加滚动事的])
    $(window).scroll(function() {
        //当时滚动条离底部60px时开始加载下一页的内容
        if (($(window).height() + $(window).scrollTop() + 120) >= $(document).height()) {
            clearTimeout(timers);
            timers = setTimeout(function() {
                page++;
                var select = $('#select').val()
				//alert(page)
                $.post("{:U('fenye1')}",{page:page,select:select},function (rel) {
					if(rel.code == 200)
					{
						$('#he').append(rel.data)
					}
                })
            }, 300);
        }
    });
</script>
